﻿using CommonData;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;

public class app : MonoBehaviour {

    private static BaseNetTcp tcp;

    public static class AppPersistentPath
    {// 持久化路径
        public static string getScriptPath()//lua脚本路径
        {
            return Application.streamingAssetsPath + "/scripts";
        }
    }

    public static void send(byte[] data) {
        tcp.send(data);
    }

    private void Awake()
    {
        LuaHelper.LoadScript.load();
        tcp = new BaseNetTcp();
        tcp.initTcp("127.0.0.1", 5001, new RecvClass());
       
    }

    void Start () {
        FBLuaDebugger.enableDebug();
    }

    void OnDestroy() {
        tcp.cloes();
        Debug.Log("client close");
    }

    void Update () {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        if (Input.GetKeyDown(KeyCode.F2) == true)
        {
            FBLuaDebugger.showConsole();
        }
#endif
    }
}




